<%-- 
    Document   : upcomingreleasespane
    Created on : Jul 28, 2012, 12:09:44 AM
    Author     : Atienza-Home
--%>

<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Movie"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Functions.ProgramFunction"%>
<%

    ArrayList<Movie> result = (ArrayList<Movie>)session.getAttribute("upcomingmovies");
    ArrayList<Movie> result2 = (ArrayList<Movie>)session.getAttribute("upcomingmovies");
    Iterator<Movie> iter;
    Iterator<Movie> iter2 =null;
    Movie movie;
    Movie movie2;
    int i=0;
    
    if(result2!=null)
        iter2 = result2.iterator();

%>

<br><br>
<div id="topupcomingpane" style=" width:840px;margin:auto; height:230px;">
    <div id="upcoming1" class="upcoming">
        <%
            movie2 = iter2.next();
        %>
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;opacity:0.8;filter:alpha(opacity=80);">
                <font color="white"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie2.getReleaseDate().toString() )%></font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 160px;max-width: 250px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>
        
        
    </div>
    	
    <div id="upcoming2" class="upcoming">
        <%
            movie2 = iter2.next();
        %>
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;opacity:0.8;filter:alpha(opacity=80);">
                <font color="white"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie2.getReleaseDate().toString() )%></font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 160px;max-width: 250px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>
        
    </div>
    	
    <div id="upcoming3" class="upcoming">
        <%
            movie2 = iter2.next();
        %>
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;opacity:0.8;filter:alpha(opacity=80);">
                <font color="white"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie2.getReleaseDate().toString() )%></font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 160px;max-width: 250px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>
        
        
    </div>

</div>
        
<br><br>

	
<div id="otherupcoming">
    <font size="2px" color="white" >
    <table width="918px" style="text-align: center;">
        <tr>
            <th width="6%">Order</th>
            <th width="28%">Release Date</th>
            <th width="60%">Movie Name</th>
                      
            <th width="6%">Review</th>
	</tr>
        
        <%
        if(result!=null){
            iter = result.iterator(); 
            while(iter.hasNext() && i<50){
                movie = iter.next();
                
                %>
                <tr>
                    
                    <td><font color="white" size="3px"><%=i+1%></font></td>
                    <td><font color="white" size="3px"><%=ProgramFunction.convertMySQLDateFormatToWebDateFormat(movie.getReleaseDate().toString() )%></font></td>
                    <td><font color="white" size="3px"><%=movie.getName()%></font></td>
                                        
                    <td><a href="movie.jsp?id=<%=movie.getId() %>" style="color:white">View</a></td>
                </tr>
                
                
                
                
                <%
                
                
                
                
                i++;
            }
        }
                
         %>       
        
        
    </table>
</font>
</div>
